package com.tiny.factory.pizzafm;

/**
 * Created by zhumenglong on 2017/4/2.
 */
public class NYPizzaStore extends PizzaStore {

    Pizza createPizza(String item) {
        if (item.equals("cheese")) {
            return new NYStyleCheesePizza();
        } else if (item.equals("veggie")) {
            return new NYStyleVeggiePizza();
        } else if (item.equals("clam")) {
            return new NYStyleClamPizza();
        } else if (item.equals("pepperoni")) {
            return new NYStylePepperoniPizza();
        } else return null;
    }

    protected class NYStyleCheesePizza extends Pizza {
        public NYStyleCheesePizza() {
            name = "NY Style Sauce and Cheese Pizza";
            dough = "Thin Crust Dough";
            sauce = "Marinara Sauce";

            toppings.add("Grated Reggiano Cheese");
        }
    }

    protected class NYStyleVeggiePizza extends Pizza {
        public NYStyleVeggiePizza() {
            name = "NY Style Veggie Pizza";
            dough = "Thin Crust Dough";
            sauce = "Marinara Sauce";

            toppings.add("Grated Reggiano Cheese");
            toppings.add("Garlic");
            toppings.add("Onion");
            toppings.add("Mushrooms");
            toppings.add("Red Pepper");
        }
    }

    protected class NYStyleClamPizza extends Pizza {
        public NYStyleClamPizza() {
            name = "NY Style Clam Pizza";
            dough = "Thin Crust Dough";
            sauce = "Marinara Sauce";

            toppings.add("Grated Reggiano Cheese");
            toppings.add("Fresh Clams from Long Island Sound");
        }
    }

    protected class NYStylePepperoniPizza extends Pizza {
        public NYStylePepperoniPizza() {
            name = "NY Style Pepperoni Pizza";
            dough = "Thin Crust Dough";
            sauce = "Marinara Sauce";

            toppings.add("Grated Reggiano Cheese");
            toppings.add("Sliced Pepperoni");
            toppings.add("Garlic");
            toppings.add("Onion");
            toppings.add("Mushrooms");
            toppings.add("Red Pepper");
        }
    }
}

